<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
    <input class="week" type="text">
    <button class="eating">
        点击查看吃啥
    </button>
    <script>
        var week=document.getElementsByClassName("week")[0];
        console.log(week)
        var eating=document.getElementsByClassName("eating")[0];
        eating.onclick=function(){
            var event=week.value;
            if(event=="星期一"){
                alert("吃鸡公煲")
            }else if(event=="星期二"){
                alert("吃煲仔饭")
            }else if(event=="星期三"){
                alert("吃麻辣烫")
            }else if(event=="星期四"){
                alert("吃炒饭")
            }else if(event=="星期五"){
                alert("吃田老师")
            }else if(event=="星期六"){
                alert("做饭")
            }else if(event=="星期天"){
                alert("吃火锅")
            }else{
                alert("输入错误，请输入‘星期一’到‘星期天’")
            }
        }
    </script>
</body>
</html>